package org.ysh.service;

import org.springframework.stereotype.Service;
import org.ysh.domain.Department;
import org.ysh.mapper.BaseMapper;
import org.ysh.mapper.DeptMapper;
import org.ysh.vo.TreeNodeVo;

import java.util.List;

@Service
public class DeptService extends BaseService<Integer, Department> {
    public DeptService(DeptMapper deptMapper) {
        super(deptMapper);
    }

    public List<TreeNodeVo> getDeptTree(String fondsCode) {
        Department department = new Department();
        department.setFondsCode(fondsCode);
        List<Department> departments = this.findByPage(department);
        return TreeNodeVo.buildTree(departments);
    }


}
